package com.woorigil.social;

public class StringUtil {
	public static String createIndexSourceText(String sourceText, String... texts) {
		String indexSourceText = sourceText;
		if (sourceText == null) {
			return indexSourceText;
		}

		if (texts == null) {
			return indexSourceText;
		}

		for (String each : texts) {
			if (!indexSourceText.contains(each)) {
				indexSourceText = indexSourceText + each;
			}
		}
		return indexSourceText;
	}

	public static String getOnlyDigit(String str) {
		if (str != null && str.length() != 0) {
			String tmpStr = ""; //
			char[] chArr = str.toCharArray();
			int cntcharrTelno = chArr.length;
			for (int i = 0; i < cntcharrTelno; i++) {
				if (Character.isDigit(chArr[i])) {
					tmpStr += chArr[i];
				}
			}
			return tmpStr;
		} else {
			return "";
		}
	}
}